<?php
declare (strict_types = 1);

namespace app\index\middleware;

use think\facade\Db;
use think\facade\View;

class HeaderNav
{
    /**
     * 处理请求
     *
     * @param \think\Request $request
     * @param \Closure       $next
     * @return Response
     */
    public function handle($request, \Closure $next)
    {
        //头部请求栏数据中间件

        $nav = Db::table('post_cate')->where('status',0)->field('id,cate_name')->select()->toArray();

        View::assign('nav',$nav);



        return $next($request);
    }
}
